<?php


include_once APPLICATION_DIR.'/application/model/dao/interfaces/IGroupCategoriesStmt.class.php';
class GroupCategoriesStmt implements IGroupCategoriesStmt{
    public function prepareSelectValidCategoriesByGroup($group_id,$supplier_id = 0){
        return " SELECT c.ID AS CATEGORY_ID,c.NAME CATEGORY_NAME,c.TOTAL_PRODUCT  
                 FROM rz_group_categories gc
                 INNER JOIN rz_category c ON gc.GROUP_ID = {$group_id} AND c.ENABLED IS NOT NULL AND gc.CATEGORY_ID = c.ID "
                     . ($supplier_id != 0  ? " AND c.SUPPLIER_ID = {$supplier_id} " : "");
    }
    
}
